package Practice03_exam;

public class Rectangle2 {
    private Point c = null;
    private Point b = null;

    public Rectangle2(Point c, Point b){
        this.c = c;
        this.b = b;
    }

    public int calculateC(){
        return 2*(Math.abs(c.getX()-b.getX())+Math.abs(c.getY()-b.getY()));
    }

    public int calculateS(){
        return Math.abs(c.getX()- b.getX())*Math.abs(c.getY()- b.getY());
    }

    public Point getC() {
        return c;
    }

    public void setC(Point c) {
        this.c = c;
    }

    public Point getB() {
        return b;
    }

    public void setB(Point b) {
        this.b = b;
    }
}
